cmake_minimum_required(VERSION 2.6)
project(Game)

include_directories(
    ${PROJECT_SOURCE_DIR}
    ${PROJECT_SOURCE_DIR}/../
)

set(Game_SRC
    GameApplication.h
    GameApplication.cc
    GameSystem.h
    GameSystem.cc
    Global.h
    SharedDefines.h
    PacketFilter.h
    PacketFilter.cc
    Common.h
    Common.cc
    
    Game/Pet.h
    Game/Player.h
    Game/PlayerDefines.h
    Game/Player.cc
    Game/PlayerCharacter.cc
    Game/PlayerActionButton.cc
    Game/ItemProtoType.h
    Game/ObjectManager.h
    Game/ObjectManager.cc
    Game/ObjectManagerLoad.cc
    Game/ObjectGuid.h
    Game/ObjectGuid.cc
    Game/Creature.h
    Game/Creature.cc
    Game/DBCFmt.h
    Game/DBCStructure.h
    Game/DBCStores.h
    Game/DBCStores.cc
    Game/DBCEnums.h
    Game/MapManager.h
    Game/MapManager.cc
    Game/GridDefines.h
    Game/Map.h
    Game/SQLStorages.h
    Game/SQLStorages.cc
    Game/SQLStorageFmt.h
    Game/Bag.h
    Game/NPCHandler.h
    Game/ItemEnchantmentMgr.h
    Game/ItemEnchantmentMgr.cc
    
    Server/GameSocketHandler.h
    Server/GameSocketHandler.cc
    Server/GameSocketHandlerFactory.h
    Server/GameSession.h
    Server/GameSession.cc
    Server/OpcodeHandler.h
    Server/OpcodeHandler.cc
    
    World/World.h
    World/World.cc
    World/WorldTimer.h
    World/WorldTimer.cc
    World/WorldThread.h
    World/WorldThread.cc
    World/AddonHandler.h
    World/AddonHandler.cc
    World/CharacterHandler.cc
)

if(WIN32)
    set(Game_SRC
        Main_WIN32.cc
        Game.rc
    ${Game_SRC})
endif()

add_executable(Game ${Game_SRC})
target_link_libraries(Game
    Shared
    zlib
    ${Libevent_Libraries}
    ${MySQL_Libraries}
    ${OpenSSL_Libraries}
)
if (WIN32)
target_link_libraries(Game 
    ws2_32 
)
endif()